export default function useTableAction(
  emits: (event: 'reset' | 'remove', ...args: string[]) => void
) {
  // 打开上级目录
  function handleOpenPath(path: string) {
    window.api.openPath(path)
  }

  // 移除
  function handleRemove(fullPath: string) {
    if (fullPath) {
      emits('remove', fullPath)
    }
  }

  // 重置
  function handleRest() {
    emits('reset')
  }

  return {
    handleOpenPath,
    handleRemove,
    handleRest
  }
}
